<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>注册</title>
		<link rel="stylesheet" href="./css/reset.css">
		<link rel="stylesheet" href="./css/common.css">
		<link rel="stylesheet" href="./css/login.css">
		<link rel="stylesheet" type="text/css" href="js/jquery.js"/>
		<link rel="stylesheet" href="plugins/font-awesome-4.7.0/css/font-awesome.min.css">
			
		<script src="./js/jquery.js" type="text/javascript" charset="utf-8"></script>
		<script>
			 $(function(){
				$("div.button-login").on("click",function(){							
					var name = $("input[name='name']").val();
					var loginName = $("input[name='loginName']").val();
					var password = $("input[name='password']").val();
					var img = $("input[name='img']").val();
					var phone = $("input[name='phone']").val();
					
						$.ajax({
							type: "POST",
							url: "http://192.168.150.202:8080/Api/customers",
							data: "name=" + name + "&loginName=" + loginName + "&password=" + password + "&img=" + img + "&phone=" + phone + "&action=add",					
							success: function(responseData) {    //{"success":false,"msg":"xx"}
								if (responseData.success) {
									console.log(responseData);
									alert('注册成功');
								} else {
									alert(msg);
									
								}
							}
						});
					});
				 });
				
			
		</script>
		
	</head>
	<body>
		<div class="footer">
		    <ul>
			    <a href="index.html"><li><i class="fa fa-home"></i>首页</li></a>
			    <a href="shop.html"><li><i class="fa fa-chrome"></i>店铺</li></a>
			    <a href="order.html"><li><i class="fa fa-tasks"></i>订单</li></a>
			    <a href="mine.html"><li><i class="fa fa-user-o"></i>我的</li></a>
		    </ul>
		</div>
		<div class="wrapper">
			
			<header>
				<p>用户注册</p>
			</header>
			
			<!-- 表单部分 -->
			<ul class="form-box">
				<li>
					<div class="title">
						账号：
					</div>
					<div class="content">
						<input type="text" name="name" placeholder="账号">
					</div>
				</li>
				
				<li>
					<div class="title">
						密码：
					</div>
					<div class="content">
						<input type="password" name="loginName" placeholder="密码">
					</div>
				</li>
					<li>
					<div class="title">
							再次确认：
						</div>
						<div class="content">
							<input type="password" name="password" placeholder="再次确认">
						</div>
				</li>	
				<li>	
						<div class="title">
							手机号码：
						</div>
						<div class="content">
							<input type="text" name="img" placeholder="手机号码">
						</div>
						</li>
				<li>
						<div class="title">
								个人爱好：
							</div>
							<div class="content">
								<input type="text" name="phone" placeholder="个人爱好">
							</div>
						
						
							
				</li>
			</ul>
			

			<div class="button-login">
				<a href="login.html"><button>注册</button></a>
			</div>
		    
		</div>
	</body>
</html>
